<?php
$options = Node::model()->validateTypeOptions;
$datas = array();
$not_in = array('Article');
foreach ($options as $key => $value) {
    if (!in_array($key, $not_in)) {
        $datas[$key] = array(
            "text" => CHtml::link("<span>$value</span>", array("recycleBin/{$key}"), array('target' => 'mask')), "expanded" => true, "classes" => "important",
        );
    }
}
$this->widget('CTreeView', array(
    'persist' => 'cookie', 'data' => $datas, 'animated' => 'fast', 'htmlOptions' => array(
        'id' => 'treeview', 'class' => 'filetree treeview-famfamfam'
    )
));
?>
<script type="text/javascript">
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    //extra height in px to add to iframe in FireFox 1.0+ browsers
    var FFextraHeight=getFFVersion>= 0.1 ? 16 : 0
    function dyniframesize(iframename) {
        var minHeight = 400;
        var pTar = null;
        if (document.getElementById){
            pTar = document.getElementById(iframename);
        } else{
            eval('pTar = ' + iframename + ';');
        }
        if (pTar && !window.opera){
            //begin resizing iframe
            pTar.style.display="block"
            if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) {
                //ns6 syntax
                h = (parseInt(pTar.contentDocument.body.offsetHeight+FFextraHeight) < minHeight)
                    ? minHeight
                    : parseInt(pTar.contentDocument.body.offsetHeight+FFextraHeight);
                pTar.height = h;
            } else if (pTar.Document && pTar.Document.body.scrollHeight){
                //ie5+ syntax
//                alert(pTar.Document.body.scrollHeight);
                h = (parseInt(pTar.Document.body.scrollHeight) < minHeight)
                    ? minHeight
                    : parseInt(pTar.Document.body.scrollHeight);
                pTar.height = h;
            }
        }
    }
</script>
